package pong.game.artificial_intelligence;

import pong.game.objects.GL_Washer;
import pong.game.user.Player;
import pong.mathematic.Vector3D;

public abstract class Bot extends Player {

	public Bot(String userName, Vector3D center, float width, float height) {
		super(userName, center, width, height);
	}

	protected abstract GL_Washer getDangerWasher();

	protected abstract void moveToDangerWasher(GL_Washer dangerWasher, float timeFraction);

	protected abstract void impulseActivate(GL_Washer dangerWasher);

	private void botLogic(float timeFraction) {
		GL_Washer dangerWasher = getDangerWasher();
		moveToDangerWasher(dangerWasher, timeFraction);
		impulseActivate(dangerWasher);
	}

	@Override
	public void moveEnts(float maxSpeed, float timeFraction) {
		botLogic(timeFraction);
		super.moveEnts(maxSpeed, timeFraction);
	}
}
